Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify '$or' operator #1749

Merged
merged 2 commits into from
Jan 22, 2020
Merged

Modify '$or' operator #1749

merged 2 commits into from
Jan 22, 2020

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Dec 18, 2019

Changes / Features implemented

  • Modify '$or' operator. Enable the operator to accept null values
/api/v1/data/<form_id>?start=0&limit=100&query={"$or": [{"_review_status":"1", "_review_status": null}]}

Steps taken to verify this change does what is intended

  • Added tests to verify the filter option works

Side effects of implementing this change

None so far

Closes #1743

@DavisRayM DavisRayM changed the title Set default submission review status [WIP] Set default submission review status Dec 18, 2019
@DavisRayM DavisRayM force-pushed the 1743-default-submission-review branch 8 times, most recently from b02272f to 1e485cf Compare January 13, 2020 12:21
@DavisRayM DavisRayM changed the title [WIP] Set default submission review status [WIP] Add 'ornull' filter option Jan 13, 2020
@DavisRayM DavisRayM changed the title [WIP] Add 'ornull' filter option Add 'ornull' filter option Jan 13, 2020
Copy link
Member

@ukanga ukanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the genesis of $ornull?

The history of the $ query values comes from us directly using MongoDB query structure when we still used MongoDB. Perhaps we should look at this from the perspective of a MongoDB query, and it might be more apparent how the query should be.

@DavisRayM DavisRayM force-pushed the 1743-default-submission-review branch 5 times, most recently from 63390ac to 42bc4ce Compare January 15, 2020 11:06
@DavisRayM
Copy link
Contributor Author

DavisRayM commented Jan 15, 2020

Where is the genesis of $ornull?

The history of the $ query values comes from us directly using MongoDB query structure when we still used MongoDB. Perhaps we should look at this from the perspective of a MongoDB query, and it might be more apparent how the query should be.

I came up with $ornull operator on the spot. Researched a bit more into the MongoDB query structure. I've updated the code to accept null values when querying through the $or operator.

@DavisRayM DavisRayM changed the title Add 'ornull' filter option [WIP] Add 'ornull' filter option Jan 15, 2020
@DavisRayM DavisRayM changed the title [WIP] Add 'ornull' filter option [WIP] Modify '$or' operator Jan 16, 2020
ukanga
ukanga previously approved these changes Jan 16, 2020
@DavisRayM DavisRayM changed the title [WIP] Modify '$or' operator Modify '$or' operator Jan 16, 2020
@DavisRayM DavisRayM added the QA- PR failed QA testing label Jan 16, 2020
@DavisRayM DavisRayM changed the title Modify '$or' operator [WIP] Modify '$or' operator Jan 16, 2020
@WNjihia WNjihia added QA+ PR passed QA testing and removed QA- PR failed QA testing labels Jan 22, 2020
@WNjihia
Copy link

WNjihia commented Jan 22, 2020

@DavisRayM @ivermac testing checks out for this PR

@DavisRayM DavisRayM force-pushed the 1743-default-submission-review branch from 42bc4ce to 33a819a Compare January 22, 2020 06:54
@DavisRayM DavisRayM changed the title [WIP] Modify '$or' operator Modify '$or' operator Jan 22, 2020
@ukanga ukanga merged commit 61f3e85 into master Jan 22, 2020
@ukanga ukanga deleted the 1743-default-submission-review branch January 22, 2020 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA+ PR passed QA testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set default submission review status when enabled
3 participants